#include <stdio.h>
#include <signal.h>
#include <unistd.h> // for sleep
#include <stdlib.h> // for exit

void handler(int signum){
    printf("Caught signal %d\n", signum);
    exit(1);
}

int main(int argc, char const *argv[])
{
    if(signal(SIGINT, handler)==SIG_ERR){
        printf("Error in signal\n");
        return 1;
    };
    while (1)
    {
        sleep(1);
        printf("Hello World\n");
    }
    
}
